package com.jihong.util;

import java.util.ArrayList;
import java.util.List;

public class MyConfig {

    public void testGit(){
        System.out.printf("hjh");
    }

    public void syzl(){
        System.out.printf("syzl.....");
    }


    public static List<EncryptData> getNeedEnField(){
        List<EncryptData> list = new ArrayList();
        list.add(new EncryptData("phone_no",false));
        return list;
    }

    public static EncryptData getEncryptData(List<EncryptData> list,String field){
        field = field.replaceAll("`","");
        for (EncryptData encryptData : list) {
            boolean equals = encryptData.getField().equals(field);
            if (equals) {
                return encryptData;
            }
        }
        return null;
    }

    public static class EncryptData{
        private String field;
        private boolean doubleWrite;

        public EncryptData(String field, boolean doubleWrite) {
            this.field = field;
            this.doubleWrite = doubleWrite;
        }

        public boolean isDoubleWrite() {
            return doubleWrite;
        }

        public void setDoubleWrite(boolean doubleWrite) {
            this.doubleWrite = doubleWrite;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        @Override
        public String toString() {
            return "EncryptData{" +
                    "field='" + field + '\'' +
                    ", doubleWrite=" + doubleWrite +
                    '}';
        }
    }


}